#!/bin/bash

CURR_DIR="$( cd "$( dirname "$0" )" && pwd )"

# PROJECT_ROOT_DIR=$CURR_DIR/../..
# SAMPLES_DIR=$PROJECT_ROOT_DIR/samples

APP_PROJECT_DIR=$CURR_DIR/../../$1/_build

if [ ! -d ../tc32/tc32/bin/ ];then
    cd  ../tc32
    tar -jxvf tc32_win.tar.gz
    cd -
fi

# # 1-cmake 构建编译系统
if [ -d $APP_PROJECT_DIR ];then
    cd $APP_PROJECT_DIR
    # shopt -s extglob
    # rm -rf !(*rar)
    if [ $2 = "clean" ]
    then
        ../../../tools/tc32/tc32/bin/make clean
    else 
        ../../../tools/tc32/tc32/bin/make all
    fi
    cd -
fi


